home *** CD-ROM | disk | FTP | other *** search
/ Shareware Grab Bag / Shareware Grab Bag.iso / 090 / lcsrc.arc / CRT_PUTC.ASM < prev    next >
Assembly Source File  |  1985-04-06  |  2KB  |  115 lines

  1.  
  2.  
  3. ;-----------------------------------------------------------------------
  4. ;
  5. ; name        crt_putcamult -- put multiple characters with attribute
  6. ;
  7. ; synopsis    VOID    crt_putcamult(ch, page, count)
  8. ;        int ch, page, count;
  9. ;
  10. ;  
  11. ; description    write character and attribute at current cursor location
  12. ;        high byte of ch is attribute, low byte is character
  13. ;
  14. ;        page is page # to place text on (text modes only)
  15. ;
  16. ;        Count is # of times to put character (good for top
  17. ;        and bottom of boxes).
  18. ;
  19. ;----------------------------------------------------------------------
  20.  
  21. ;-----------------------------------------------------------------------
  22. ;
  23. ; name        crt_putch -- put character only at current cursor
  24. ;
  25. ; synopsis    VOID    crt_putch(ch, page, count)
  26. ;            int ch, page, count;
  27. ;
  28. ;  
  29. ; description    Write character only at current cursor location -
  30. ;        existing attributes are used.
  31. ;
  32. ; notes        Page is page # to place text on (text modes only).
  33. ;
  34. ;        Count is # of times to put character.
  35. ;
  36. ;----------------------------------------------------------------------
  37.  
  38.  
  39.  
  40.     include    dos.mac
  41.  
  42. video    equ    10h        ; video interrupt number
  43.  
  44.  
  45.     IF    LPROG
  46. X    EQU    6        ;OFFSET OF ARGUMENTS
  47.     ELSE
  48. X    EQU    4        ;OFFSET OF ARGUMENTS
  49.     ENDIF
  50.  
  51.     PSEG
  52.  
  53.  
  54.  
  55.  
  56.     PUBLIC    crt_putcamult
  57.  
  58.     IF    LPROG
  59. crt_putcamult    PROC    FAR
  60.     ELSE
  61. crt_putcamult    PROC    NEAR
  62.     ENDIF
  63.  
  64.  
  65.     push    bp
  66.     call    vput1        ; set up for routine
  67.     mov    ah,9        ; multiple times
  68.     int    video
  69.     pop    bp
  70.     ret
  71.  
  72. crt_putcamult    endp
  73.  
  74. ;
  75. ; internal routine
  76. ;
  77.  
  78. vput1    proc    near
  79.  
  80.     mov    bp,sp
  81.     mov    ax,[bp+x+2]    ; attribute and character
  82.     mov    bh,[bp+x+4]
  83.     mov    cx,[bp+x+6]
  84.     mov    bl,ah
  85.     ret
  86.  
  87. vput1    endp    
  88.     
  89.  
  90.  
  91.  
  92.  
  93.  
  94.     PUBLIC    crt_putch
  95.  
  96.     IF    LPROG
  97. crt_putch    PROC    FAR
  98.     ELSE
  99. crt_putch    PROC    NEAR
  100.     ENDIF
  101.  
  102.  
  103.     push    bp
  104.     call    vput1
  105.     mov    ah,10        ; write character only function
  106.     int    video
  107.     pop    bp
  108.     ret
  109.  
  110. crt_putch    endp
  111.  
  112.  
  113.     endps
  114.     end
  115.